package com.superzqb.asus.superzqbFragment.superzqbNews;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.superzqb.asus.superzqb.R;

public class NewsContentActivity extends Activity implements View.OnClickListener{
    private Intent intent;
    private String type;
    private ImageView back;
    private TextView title;
    private RelativeLayout bg;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news_content);
        initView();
    }

    private void initView() {
        intent=getIntent();
        type=intent.getStringExtra("type");
        back=(ImageView)findViewById(R.id.back);
        title=(TextView)findViewById(R.id.title);
        bg=(RelativeLayout)findViewById(R.id.bg);
        if(type.equals("1")){
            title.setText("校园兼职小助手");
            bg.setBackground(getResources().getDrawable(R.mipmap.type1));
        }else if(type.equals("2")){
            title.setText("企业兼职小助手");
            bg.setBackground(getResources().getDrawable(R.mipmap.type2));
        }else if(type.equals("3")){
            title.setText("分期小助手");
            bg.setBackground(getResources().getDrawable(R.mipmap.type3));
        } else if(type.equals("4")){
            title.setText("攒攒钱小助手");
            bg.setBackground(getResources().getDrawable(R.mipmap.type4));
        }
        back.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.back:
                finish();
                break;
            default:break;
        }
    }
}
